import { createRequest } from '/@/api/service';
const module = 'ib/base/v1/DeviceDetailApi/';

/**
 * @function 查询物联设备IOT设备运行状态
 * @param data
 * @param header
 * @returns {Promise}
 */
function RUN_STATE_QUERY(
  data: DeviceDetailApi.RunStateQueryReq,
  header: object = {},
): Promise<DeviceDetailApi.RunStateQueryResp> {
  return createRequest(`${process.env.APP_API_URL}${module}runState`, data, header, 'POST');
}

/**
 * @function 控制物联设备开关状态信息
 * @param data
 * @param header
 * @returns {Promise}
 */
function CTRL_SWITCH_STATUS(
  data: DeviceDetailApi.CtrlSwitchStatusReq,
  header: object = {},
): Promise<DeviceDetailApi.CtrlSwitchStatusResp> {
  return createRequest(`${process.env.APP_API_URL}${module}ctrlSwitchStatus`, data, header, 'POST');
}

export { RUN_STATE_QUERY, CTRL_SWITCH_STATUS };
